]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
telepathy: Use string.replace in a way compatible with newer Spidermonkey
authorColin Walters <walters@verbum.org>
Fri, 24 Sep 2010 17:55:12 +0000 (13:55 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 30 Sep 2010 16:43:12 +0000 (12:43 -0400)
The semantics of the first argument changed from literal -> regexp
if the 'g' option was specified.  To remove ambiguity, stop using
the spidermonkey extension and create a standard RegExp object.

https://bugzilla.gnome.org/show_bug.cgi?id=630539

js/misc/telepathy.js

index e4d1a7aee2b1ddbd3d0bc0d23a20302e5ec72df1..c1443fb3027667993d19677c13a778cc920f3905 100644 (file)
@@ -17,13 +17,13 @@ function makeProxyClass(iface) {
 }
 
 function nameToPath(name) {
-    return '/' + name.replace('.', '/', 'g');
+    return '/' + name.replace(/\./g, '/');
 };
 
 function pathToName(path) {
     if (path[0] != '/')
         throw new Error('not a D-Bus path: ' + path);
-    return path.substr(1).replace('/', '.', 'g');
+    return path.substr(1).replace(/\//g, '.');
 };
 
 // This is tp_escape_as_identifier() from telepathy-glib